package com.longge;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-05-23 01:28
 */
public class ReverseString {
    public void reverseString(char[] s) {

        int p1 = 0, p2 = s.length - 1;
        while (p1 < p2) {
            char temp = s[p1];
            s[p1++] = s[p2];
            s[p2++] = temp;
        }
    }
}
